public class ProxyImage implements Image{
    private RealImage realImage;
    private String fileName;
    public ProxyImage(String fileName){
        this.fileName = fileName;
    }
    @Override
    public void display() {
        //使用代理，减少RealImage创建次数
        if (realImage==null) {
            this.realImage = new RealImage(fileName);
        }
        realImage.display();
    }
}
